package com.ssd.api.user.dto;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
import lombok.experimental.Accessors;

import javax.validation.constraints.DecimalMin;

/**
 * <p>
 * 地址薄
 * </p>
 *
 * @author author
 * @since 2024-11-14
 */
// 使用Lombok注解@Data，自动生成getter和setter方法，简化代码
// @EqualsAndHashCode(callSuper = false)注解，自动生成equals和hashCode方法，不考虑父类对象
// @Accessors(chain = true)注解，开启链式调用，提高代码可读性和编写效率
// @TableName("address_book")注解，指定与实体类对应的数据库表名
// @ApiModel注解，用于Swagger文档中描述AddressBook对象，提供对象的用途和描述信息
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("address_book")
@ApiModel(value="AddressBook对象", description="地址薄")

public class AddressBook implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
    @TableId(value = "id", type = IdType.AUTO)
    @DecimalMin(value = "1")
    private Long id;

    @ApiModelProperty(value = "用户id")
    private Long userId;

    @ApiModelProperty(value = "名称")
    private String name;

    @ApiModelProperty(value = "电话")
    private String phone;

    @ApiModelProperty(value = "省份")
    private String province;

    @ApiModelProperty(value = "市级")
    private String city;

    @ApiModelProperty(value = "区/县")
    private String county;

    @ApiModelProperty(value = "详细地址")
    private String address;

    @ApiModelProperty(value = "经度")
    private Double lon;

    @ApiModelProperty(value = "纬度")
    private Double lat;

    @ApiModelProperty(value = "是否为默认地址，0：否，1：是")
    private Integer isDefault;

    @ApiModelProperty(value = "创建时间")
    @JsonIgnore
    private LocalDateTime createTime;
    @JsonIgnore
    @ApiModelProperty(value = "更新时间")
    private LocalDateTime updateTime;

}
